package org.miku.module;

import javax.servlet.http.HttpSession;

import org.miku.sec.SecurityGuard;

public class SessionManager {
	public static final String ATTR_AUTH = "auth";
	
	private HttpSession mSession = null;
	
	public SessionManager(HttpSession session) {
		mSession = session;
	}
	
	public void addSession(String tag) {
		String encpyChar = SecurityGuard.DMB5(tag);
		mSession.setAttribute(ATTR_AUTH, encpyChar);
	}
	
	public void cleanSession() {
		mSession.removeAttribute(ATTR_AUTH);;
	}
	
	public boolean isExistSesion() {
		return mSession.getAttribute(ATTR_AUTH) != null ? true : false;
	}

}
